home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat1 / X11 / xmodmap.z / xmodmap
Text File  |  1998-10-20  |  16KB  |  397 lines

  1.  
  2.  
  3.  
  4.      XXXXMMMMOOOODDDDMMMMAAAAPPPP((((1111))))         XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))          XXXXMMMMOOOODDDDMMMMAAAAPPPP((((1111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           xmodmap - utility for modifying keymaps (and pointer
  10.           buttons) in X
  11.  
  12.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.           xxxxmmmmooooddddmmmmaaaapppp [-options ...] [filename]
  14.  
  15.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.           The _x_m_o_d_m_a_p program is used to edit and display the keyboard
  17.           _m_o_d_i_f_i_e_r _m_a_p and _k_e_y_m_a_p _t_a_b_l_e that are used by client
  18.           applications to convert event keycodes into keysyms.  It is
  19.           usually run from the user's session startup script to
  20.           configure the keyboard according to personal tastes.
  21.  
  22.      OOOOPPPPTTTTIIIIOOOONNNNSSSS
  23.           The following options may be used with _x_m_o_d_m_a_p:
  24.  
  25.           ----ddddiiiissssppppllllaaaayyyy _d_i_s_p_l_a_y
  26.                   This option specifies the host and display to use.
  27.  
  28.           ----hhhheeeellllpppp   This option indicates that a brief description of
  29.                   the command line arguments should be printed on the
  30.                   standard error channel.  This will be done whenever
  31.                   an unhandled argument is given to _x_m_o_d_m_a_p.
  32.  
  33.           ----ggggrrrraaaammmmmmmmaaaarrrr
  34.                   This option indicates that a help message describing
  35.                   the expression grammar used in files and with -e
  36.                   expressions should be printed on the standard error.
  37.  
  38.           ----vvvveeeerrrrbbbboooosssseeee
  39.                   This option indicates that _x_m_o_d_m_a_p should print
  40.                   logging information as it parses its input.
  41.  
  42.           ----qqqquuuuiiiieeeetttt  This option turns off the verbose logging.  This is
  43.                   the default.
  44.  
  45.           ----nnnn      This option indicates that _x_m_o_d_m_a_p should not change
  46.                   the mappings, but should display what it would do,
  47.                   like _m_a_k_e(_1) does when given this option.
  48.  
  49.           ----eeee _e_x_p_r_e_s_s_i_o_n
  50.                   This option specifies an expression to be executed.
  51.                   Any number of expressions may be specified from the
  52.                   command line.
  53.  
  54.           ----ppppmmmm     This option indicates that the current modifier map
  55.                   should be printed on the standard output.
  56.  
  57.           ----ppppkkkk     This option indicates that the current keymap table
  58.                   should be printed on the standard output.
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 4/30/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      XXXXMMMMOOOODDDDMMMMAAAAPPPP((((1111))))         XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))          XXXXMMMMOOOODDDDMMMMAAAAPPPP((((1111))))
  71.  
  72.  
  73.  
  74.           ----ppppkkkkeeee    This option indicates that the current keymap table
  75.                   should be printed on the standard output in the form
  76.                   of expressions that can be fed back to _x_m_o_d_m_a_p.
  77.  
  78.           ----pppppppp     This option indicates that the current pointer map
  79.                   should be printed on the standard output.
  80.  
  81.           ----       A lone dash means that the standard input should be
  82.                   used as the input file.
  83.  
  84.           The _f_i_l_e_n_a_m_e specifies a file containing _x_m_o_d_m_a_p expressions
  85.           to be executed.  This file is usually kept in the user's
  86.           home directory with a name like ._x_m_o_d_m_a_p_r_c.
  87.  
  88.      EEEEXXXXPPPPRRRREEEESSSSSSSSIIIIOOOONNNN GGGGRRRRAAAAMMMMMMMMAAAARRRR
  89.           The _x_m_o_d_m_a_p program reads a list of expressions and parses
  90.           them all before attempting to execute any of them.  This
  91.           makes it possible to refer to keysyms that are being
  92.           redefined in a natural way without having to worry as much
  93.           about name conflicts.
  94.  
  95.           kkkkeeeeyyyyccccooooddddeeee _N_U_M_B_E_R ==== _K_E_Y_S_Y_M_N_A_M_E ...
  96.                   The list of keysyms is assigned to the indicated
  97.                   keycode (which may be specified in decimal, hex or
  98.                   octal and can be determined by running the _x_e_v
  99.                   program.
  100.  
  101.           kkkkeeeeyyyyccccooooddddeeee aaaannnnyyyy ==== _K_E_Y_S_Y_M_N_A_M_E ...
  102.                   If no existing key has the specified list of keysyms
  103.                   assigned to it, a spare key on the keyboard is
  104.                   selected and the keysyms are assigned to it.  The
  105.                   list of keysyms may be specified in decimal, hex or
  106.                   octal.
  107.  
  108.           kkkkeeeeyyyyssssyyyymmmm _K_E_Y_S_Y_M_N_A_M_E ==== _K_E_Y_S_Y_M_N_A_M_E ...
  109.                   The _K_E_Y_S_Y_M_N_A_M_E on the left hand side is translated
  110.                   into matching keycodes used to perform the
  111.                   corresponding set of kkkkeeeeyyyyccccooooddddeeee expressions.  The list
  112.                   of keysym names may be found in the header file
  113.                   <_X_1_1/_k_e_y_s_y_m_d_e_f._h> (without the _X_K_ prefix) or the
  114.                   keysym database <_X_R_o_o_t>/_l_i_b/_X_1_1/_X_K_e_y_s_y_m_D_B, where
  115.                   <XRoot> refers to the root of the X11 install tree.
  116.                   Note that if the same keysym is bound to multiple
  117.                   keys, the expression is executed for each matching
  118.                   keycode.
  119.  
  120.           cccclllleeeeaaaarrrr _M_O_D_I_F_I_E_R_N_A_M_E
  121.                   This removes all entries in the modifier map for the
  122.                   given modifier, where valid name are:  SSSShhhhiiiifffftttt, LLLLoooocccckkkk,
  123.                   CCCCoooonnnnttttrrrroooollll, MMMMoooodddd1111, MMMMoooodddd2222, MMMMoooodddd3333, MMMMoooodddd4444, and MMMMoooodddd5555 (case does
  124.                   not matter in modifier names, although it does
  125.                   matter for all other names).  For example, ``clear
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 4/30/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      XXXXMMMMOOOODDDDMMMMAAAAPPPP((((1111))))         XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))          XXXXMMMMOOOODDDDMMMMAAAAPPPP((((1111))))
  137.  
  138.  
  139.  
  140.                   Lock'' will remove all any keys that were bound to
  141.                   the shift lock modifier.
  142.  
  143.           aaaadddddddd _M_O_D_I_F_I_E_R_N_A_M_E ==== _K_E_Y_S_Y_M_N_A_M_E ...
  144.                   This adds all keys containing the given keysyms to
  145.                   the indicated modifier map.  The keysym names are
  146.                   evaluated after all input expressions are read to
  147.                   make it easy to write expressions to swap keys (see
  148.                   the EXAMPLES section).
  149.  
  150.           rrrreeeemmmmoooovvvveeee _M_O_D_I_F_I_E_R_N_A_M_E ==== _K_E_Y_S_Y_M_N_A_M_E ...
  151.                   This removes all keys containing the given keysyms
  152.                   from the indicated modifier map.  Unlike aaaadddddddd,,,, the
  153.                   keysym names are evaluated as the line is read in.
  154.                   This allows you to remove keys from a modifier
  155.                   without having to worry about whether or not they
  156.                   have been reassigned.
  157.  
  158.           ppppooooiiiinnnntttteeeerrrr ==== ddddeeeeffffaaaauuuulllltttt
  159.                   This sets the pointer map back to its default
  160.                   settings (button 1 generates a code of 1, button 2
  161.                   generates a 2, etc.).
  162.  
  163.           ppppooooiiiinnnntttteeeerrrr ==== _N_U_M_B_E_R ...
  164.                   This sets to pointer map to contain the indicated
  165.                   button codes.  The list always starts with the first
  166.                   physical button.
  167.  
  168.           Lines that begin with an exclamation point (!) are taken as
  169.           comments.
  170.  
  171.           If you want to change the binding of a modifier key, you
  172.           must also remove it from the appropriate modifier map.
  173.  
  174.      EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  175.           Many pointers are designed such that the first button is
  176.           pressed using the index finger of the right hand.  People
  177.           who are left-handed frequently find that it is more
  178.           comfortable to reverse the button codes that get generated
  179.           so that the primary button is pressed using the index finger
  180.           of the left hand.  This could be done on a 3 button pointer
  181.           as follows:
  182.  
  183.                %  xmodmap -e "pointer = 3 2 1"
  184.  
  185.  
  186.           Many applications support the notion of Meta keys (similar
  187.           to Control keys except that Meta is held down instead of
  188.           Control).  However, some servers do not have a Meta keysym
  189.           in the default keymap table, so one needs to be added by
  190.           hand.  The following command will attach Meta to the Multi-
  191.           language key (sometimes labeled Compose Character).  It also
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 4/30/98)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      XXXXMMMMOOOODDDDMMMMAAAAPPPP((((1111))))         XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))          XXXXMMMMOOOODDDDMMMMAAAAPPPP((((1111))))
  203.  
  204.  
  205.  
  206.           takes advantage of the fact that applications that need a
  207.           Meta key simply need to get the keycode and don't require
  208.           the keysym to be in the first column of the keymap table.
  209.           This means that applications that are looking for a
  210.           Multi_key (including the default modifier map) won't notice
  211.           any change.
  212.  
  213.                %  xmodmap -e "keysym Multi_key = Multi_key Meta_L"
  214.  
  215.  
  216.           Similarly, some keyboards have an Alt key but no Meta key.
  217.           In that case the following may be useful:
  218.  
  219.                %  xmodmap -e "keysym Alt_L = Meta_L Alt_L"
  220.  
  221.  
  222.           One of the more simple, yet convenient, uses of _x_m_o_d_m_a_p is
  223.           to set the keyboard's "rubout" key to generate an alternate
  224.           keysym.  This frequently involves exchanging Backspace with
  225.           Delete to be more comfortable to the user.  If the _t_t_y_M_o_d_e_s
  226.           resource in _x_t_e_r_m is set as well, all terminal emulator
  227.           windows will use the same key for erasing characters:
  228.  
  229.                %  xmodmap -e "keysym BackSpace = Delete"
  230.                %  echo "XTerm*ttyModes:  erase ^?" | xrdb -merge
  231.  
  232.  
  233.           Some keyboards do not automatically generate less than and
  234.           greater than characters when the comma and period keys are
  235.           shifted.  This can be remedied with _x_m_o_d_m_a_p by resetting the
  236.           bindings for the comma and period with the following
  237.           scripts:
  238.  
  239.                !
  240.                ! make shift-, be < and shift-. be >
  241.                !
  242.                keysym comma = comma less
  243.                keysym period = period greater
  244.  
  245.  
  246.           One of the more irritating differences between keyboards is
  247.           the location of the Control and Shift Lock keys.  A common
  248.           use of _x_m_o_d_m_a_p is to swap these two keys as follows:
  249.  
  250.                !
  251.                ! Swap Caps_Lock and Control_L
  252.                !
  253.                remove Lock = Caps_Lock
  254.                remove Control = Control_L
  255.                keysym Control_L = Caps_Lock
  256.                keysym Caps_Lock = Control_L
  257.                add Lock = Caps_Lock
  258.  
  259.  
  260.  
  261.      Page 4                                          (printed 4/30/98)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      XXXXMMMMOOOODDDDMMMMAAAAPPPP((((1111))))         XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))          XXXXMMMMOOOODDDDMMMMAAAAPPPP((((1111))))
  269.  
  270.  
  271.  
  272.                add Control = Control_L
  273.  
  274.  
  275.           The _k_e_y_c_o_d_e command is useful for assigning the same keysym
  276.           to multiple keycodes.  Although unportable, it also makes it
  277.           possible to write scripts that can reset the keyboard to a
  278.           known state.  The following script sets the backspace key to
  279.           generate Delete (as shown above), flushes all existing caps
  280.           lock bindings, makes the CapsLock key be a control key, make
  281.           F5 generate Escape, and makes Break/Reset be a shift lock.
  282.  
  283.                !
  284.                ! On the HP, the following keycodes have key caps as listed:
  285.                !
  286.                !     101  Backspace
  287.                !      55  Caps
  288.                !      14  Ctrl
  289.                !      15  Break/Reset
  290.                !      86  Stop
  291.                !      89  F5
  292.                !
  293.                keycode 101 = Delete
  294.                keycode 55 = Control_R
  295.                clear Lock
  296.                add Control = Control_R
  297.                keycode 89 = Escape
  298.                keycode 15 = Caps_Lock
  299.                add Lock = Caps_Lock
  300.  
  301.  
  302.      EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT
  303.           DDDDIIIISSSSPPPPLLLLAAAAYYYY to get default host and display number.
  304.  
  305.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  306.           X(1), xev(1), _X_l_i_b documentation on key and pointer events
  307.  
  308.      BBBBUUUUGGGGSSSS
  309.           Every time a kkkkeeeeyyyyccccooooddddeeee expression is evaluated, the server
  310.           generates a _M_a_p_p_i_n_g_N_o_t_i_f_y event on every client.  This can
  311.           cause some thrashing.  All of the changes should be batched
  312.           together and done at once.  Clients that receive keyboard
  313.           input and ignore _M_a_p_p_i_n_g_N_o_t_i_f_y events will not notice any
  314.           changes made to keyboard mappings.
  315.  
  316.           _X_m_o_d_m_a_p should generate "add" and "remove" expressions
  317.           automatically whenever a keycode that is already bound to a
  318.           modifier is changed.
  319.  
  320.           There should be a way to have the _r_e_m_o_v_e expression accept
  321.           keycodes as well as keysyms for those times when you really
  322.           mess up your mappings.
  323.  
  324.  
  325.  
  326.  
  327.      Page 5                                          (printed 4/30/98)
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.      XXXXMMMMOOOODDDDMMMMAAAAPPPP((((1111))))         XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))          XXXXMMMMOOOODDDDMMMMAAAAPPPP((((1111))))
  335.  
  336.  
  337.  
  338.      AAAAUUUUTTTTHHHHOOOORRRR
  339.           Jim Fulton, MIT X Consortium, rewritten from an earlier
  340.           version by David Rosenthal of Sun Microsystems.
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.      Page 6                                          (printed 4/30/98)
  394.  
  395.  
  396.  
  397.